<!DOCTYPE html>
<html lang="zh-cn">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <meta name="ngrok-skip-browser-warning" content="true">
    <title>{% block title %}综合社区{% endblock %}</title>
    <link href="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/css/bootstrap.min.css" rel="stylesheet">
    <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
</head>
<body>
<nav class="navbar navbar-expand-lg navbar-dark bg-dark">
  <div class="container-fluid">
    <a class="navbar-brand" href="/">综合社区</a>
    <button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarNav" aria-controls="navbarNav" aria-expanded="false" aria-label="Toggle navigation">
      <span class="navbar-toggler-icon"></span>
    </button>
    <div class="collapse navbar-collapse" id="navbarNav">
      <ul class="navbar-nav me-auto mb-2 mb-lg-0">
        <li class="nav-item"><a class="nav-link" href="/board">讨论板</a></li>
        <li class="nav-item"><a class="nav-link" href="/chat">聊天室</a></li>
        {% if current_user.is_authenticated %}
        <li class="nav-item"><a class="nav-link" href="{{ url_for('create_group') }}">创建群聊</a></li>
        <li class="nav-item"><a class="nav-link" href="{{ url_for('my_groups') }}">我的群聊</a></li>
        {% endif %}
        <li class="nav-item"><a class="nav-link" href="/repos">进入仓库首页</a></li>
        <li class="nav-item"><a class="nav-link" href="{{ url_for('cloud') }}">我的网盘(已废弃)</a></li>
      </ul>
      <ul class="navbar-nav">
        {% if current_user.is_authenticated %}
        <li class="nav-item"><span class="nav-link">
            <a href="{{ url_for('creator_home', user_id=current_user.id) }}" style="color: inherit; text-decoration: none;">
                {{ current_user.username or current_user.email }}
            </a>
        </span></li>
        <li class="nav-item"><a class="nav-link" href="/favorites">我的收藏</a></li>
        <li class="nav-item"><a class="nav-link" href="/account">账号与安全</a></li>
        <li class="nav-item"><a class="nav-link" href="/logout">退出</a></li>
        {% else %}
        <li class="nav-item"><a class="nav-link" href="/login">登录</a></li>
        <li class="nav-item"><a class="nav-link" href="/register">注册</a></li>
        {% endif %}
      </ul>
    </div>
  </div>
</nav>
<div class="container">
    {% with messages = get_flashed_messages() %}
      {% if messages %}
        <div class="alert alert-info mt-3">
          {% for message in messages %}
            <div>{{ message }}</div>
          {% endfor %}
        </div>
      {% endif %}
    {% endwith %}
    {% block content %}{% endblock %}
</div>
<script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0/dist/js/bootstrap.bundle.min.js"></script>
<script>
document.addEventListener('DOMContentLoaded', function() {
    // 其他初始化代码可以放在这里
});
</script>
</body>
</html>
